﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib uri="/struts-tags" prefix="s" %> 
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>WorkRequest View</title>
<script language="javascript" type="text/javascript" src="js/jquery-1.8.3.js"></script>
<script language="JavaScript" src="<%=basePath %>js/jquery-calendar.js"></script>
<link href="css/jquery-calendar.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
//<![CDATA[
$(document).ready(function (){
	$("#startProposedDate,#endProposedDate,#startPtransDate,#endPtransDate").calendar({
		//初始化
		dateFormat: 'YMD/',     //日期格式
		timeSeparators:''       //时分设置
	});
});
//]]>
var test ={"print":"<s:text name='MSG00005'/>"};
function showDetail(wrId) {
    document.getElementById("wrIdDetail").value = wrId;
    document.forms["wrinfo"].action = "ListWrById_wrView";
    document.forms["wrinfo"].submit();
}
function add() {
    document.getElementById("wrIdDetail").value = "";
    document.forms["wrinfo"].action = "addDefault_wrView";
    document.forms["wrinfo"].submit();
}
function EditWr(wrId) {
    document.getElementById("wrIdDetail").value = wrId;
    document.forms["wrinfo"].action = "editWr_wrView";
    document.forms["wrinfo"].submit();
}

function showDelete(wrId) {
	var r = confirm("确定删除么？");
	if (r)
	  {
		document.getElementById("wrIdDetail").value = wrId;
		document.forms["wrinfo"].action = "deleteWr_wrView";
		document.forms["wrinfo"].submit();
	  }
}
function searchBywrId() {
		document.forms["search"].action = "searchBywrId_wrView";
		document.forms["search"].submit();
}
function displayDiv() {
	document.getElementById("div").style.display = "";
}
</script> 
</head>
<body>
<%@ include file="topmenu.jsp" %>
<c:set var="id" value="${userInfo.roleid}"></c:set>
<CENTER>
<div id="container">
<div id="button" style="padding-left: 10px; margin-bottom: -20px; margin-top:10px;">
	<div style="padding-bottom:10px;">
		<s:submit value = "%{getText('COMMON_BUTTON_SEARCH')}" onclick="displayDiv();" 
		cssClass="ButtonCss"/>
	</div>
	<div style="padding-bottom:10px;">
		<c:if test="${id!=1}">
		<s:submit value = "%{getText('COMMON_BUTTON_ADD')}" onclick="add()" cssClass="ButtonCss"/>
		</c:if>
	</div>
</div>
	<div id="div" style="display: none;margin-top: 10px;">
	<s:form method = "post" name ="search" theme="simple">
	<table class="table" style="width:600px;">
		<tr align="left" >
		<td align="left" style="padding-left:8px;">
		<s:property value="%{getText('CMS00002_LABEL_WRID')}"/>
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		<s:textfield name="workRequestViewBean.basewrNo" cssStyle="width: 70px;" />
		<s:property value="%{getText('CMS00002_LABEL_STATUS')}"/>
		<s:select list="workRequestViewBean.selectListBean.statusList" name = "workRequestViewBean.status" 
		listKey="key" listValue="name" headerValue="All" headerKey="0"cssStyle="width: 76px;"/>
			</td>
			<td align="left"><s:property value="%{getText('CMS00002_LABEL_PROPOSEDDATE')}"/>
			&nbsp;&nbsp;
			<s:textfield name="workRequestViewBean.startProposedDate" id="startProposedDate" 
				cssStyle="width:76px;"/>
				--
				<s:textfield name="workRequestViewBean.endProposedDate" id="endProposedDate" 
				cssStyle="width:76px;"/>
			</td>
		</tr>
		<tr align="left">
			<td align="left"><s:property value="%{getText('COMMON_LABEL_RESPONSIBLEUSER')}"/>
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			<s:select list="workRequestViewBean.selectListBean.allUserName" name = "workRequestViewBean.userId" 
				listKey="key" listValue="name" headerValue="All" headerKey="0" 
				cssStyle="width: 76px;"/></td>
			<td><s:property value="%{getText('CMS00002_LABEL_PTRANSDATE')}"/>
				<s:textfield name="workRequestViewBean.startPtransDate" id="startPtransDate" 
				cssStyle="width:76px;"/>
				--
				<s:textfield name="workRequestViewBean.endPtransDate" id="endPtransDate" 
				cssStyle="width:76px;"/>
			</td>
		</tr>
		<tr>
			<td></td>
			<td align="right" style="padding-right:45px;">
				&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
				<s:submit value = "%{getText('COMMON_BUTTON_SUBMIT')}" onclick="searchBywrId()" cssClass="ButtonCss"/>
			</td>
		</tr>
	</table>
	</s:form>
	</div>
		<div id="content">
				<table class="table">
					<tr>				
						<th style="width:30px;"> <s:text name="CMS00002_LABEL_WRID"/> </th>
						<th style="width:100px;"> <s:text name="CMS00002_LABEL_WRNAME"/> </th>
						<th style="width:30px;"> <s:text name="CMS00002_LABEL_STATUS"/> </th>
						<th style="width:40px;"> <s:property value="%{getText('CMS00002_LABEL_RESOURCESNAME')}" escape="false"/> </th>
						<th style="width:50px;"> <s:text name="CMS00002_LABEL_CDCREVIEW"/> </th>
						<th style="width:50px;"> <s:text name="CMS00002_LABEL_TOKYOREVIEW"/> </th>
						<th style="width:50px;" > <s:text name="CMS00003_LABLE_SMHOUR"/> </th>
						<th style="width:50px;"> <s:text name="CMS00003_LABLE_SMSTTARTDATE"/> </th>
						<th style="width:50px;"> <s:property value="%{getText('CMS00002_LABLE_DUEDATE')}" escape="false"/> </th>
						<th style="width:27px;"><s:property value="%{getText('CMS00002_LABEL_ACTUALHOUR')}" escape="false"/> </th>
						<th style="width:50px;"> <s:property value="%{getText('CMS00002_LABEL_SDATE')}" escape="false"/> </th>
						<th style="width:50px;"> <s:property value="%{getText('CMS00002_LABEL_MODIFYENDDATE')}" escape="false"/> </th>
						<th style="width:50px;"> <s:text name="CMS00003_LABLE_ACHIEVEMENT"/> </th>
						<th style="width:50px;"> <s:property value="%{getText('CMS00002_LABEL_QTRANSDATE')}" escape="false"/> </th>
						<th style="width:50px;"> <s:property value="%{getText('CMS00002_LABLE_ETRANDATE')}" escape="false"/> </th>
						<th style="width:50px;"> <s:property value="%{getText('CMS00002_LABLE_PTRANDATE')}" escape="false"/> </th>
						<th style="width:30px"> <s:text name="COMMON_BUTTON_LOOK"/> </th>
						<c:if test="${id!=1}"><th style="width:30px"><s:text name="COMMON_BUTTON_EDIT"/></th></c:if>
						<c:if test="${id!=1}"><th style="width:30px"><s:text name="COMMON_BUTTON_DELETE"/></th></c:if>
					</tr>
					<c:if test="${not empty workRequestViewBean.allwrList}">
						<c:forEach items="${workRequestViewBean.allwrList}" var="wr">
						  <tr>
							  <td class="tdNumber">${wr.basewrNo}<input type="hidden" name="wrId" value="${wr.wrId}"/></td>
							  <td class="tdString" style="word-break:break-all; ">${wr.wrName}</td>
							  <td class="tdString">${wr.status}</td>
							  <td class="tdString">${wr.inChargeCdcKey}</td>
							  <td class="tdString">${wr.cdcReview} </td>
							  <td class="tdString">${wr.submittedKey}</td>
							  <td class="tdString">${wr.smHour}</td>
							  <td class="tdString">${wr.smStartDate}</td>
							  <td class="tdString">${wr.dueDate}</td>
							  <td class="tdNumber">${wr.actualHour}</td>
							  <td class="tdString">${wr.sdate}</td>
							  <td class="tdString">${wr.modifyEndDate}</td>
							  <td class="tdNumber">${wr.percentage}</td>
							  <td class="tdString">${wr.qtransDate}</td>
							  <td class="tdString">${wr.etransDate}</td>
							  <td class="tdString">${wr.ptransDate}</td>
							  <td align="center"><input type="button" value = "V" onclick="showDetail('${wr.wrId}')" 
							  class="ButtonCss" style="width: 20px;"/></td>
	                          <c:if test="${id!=1}"><td align="center"><input type="button" value = "E" onclick="EditWr('${wr.wrId}')" 
	                          class="ButtonCss" style="width: 20px;"/></td></c:if>
	                          <c:if test="${id!=1}"><td align="center"><input type="button" value = "D" onclick="showDelete('${wr.wrId}')" 
	                          class="ButtonCss" style="width: 20px;"/></td></c:if>
						  </tr>
						</c:forEach>
					</c:if>
				</table>
		</div>
		<div id="footer">Copyright accenture.com.cn</div>
		<s:form method = "post"  name ="wrinfo">
	    	<input type="hidden" name="workRequestViewBean.wrId" id="wrIdDetail"/>
	    </s:form>
</div>
</CENTER>
</body>
</html>	
	
